﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OrderingPlatform.BllService.OrderService;
using OrderingPlatform.MvcExtension;

namespace OrderingPlatform.WebUI.Areas.Products.Controllers
{
    public class OrderController : Controller
    {
        private readonly OrderService _orderService = new OrderService();
        //
        // GET: /Products/Order/

        public ActionResult Index()
        {
            return View();
        }

      
        public string ShoppingCartUpdate(Guid? productId, int buyCount)
        {
            _orderService.ShoppingCartUpdate(productId, buyCount);
            return string.Empty;
        }

        /// <summary>
        /// 获取COOKIES
        /// </summary>
        /// <returns></returns>
        public string GetShoppingCart()
        {
            return _orderService.ShoppingCart().ToJson();
        }
    }
}
